import {catelist} from "@/request/api"

interface cateList {
    cateList:Array<object>
}

const state = {
    cateList:[]
}
const getters = {
    getCate(state:cateList){
        return state.cateList
    }

}
const mutations = {
    REQ_CATELIST(state:cateList, payload:any) {
        state.cateList = payload
    }

}
const actions = {
    getCateListAction(context:any) {
        catelist({istree:true}).then((res:any)=>{
            console.log(res);
            if(res.code==200){
                context.commit("REQ_CATELIST",res.list)
            }
        })
    }

}
export default {
    state,
    getters,
    mutations,
    actions,
    namespaced:true
}